package enterprise.manage.entity;

import javax.persistence.*;
import java.util.Calendar;

/**
 * Created by IntelliJ IDEA.
 * User: zhenmingyue
 * Date: 2012-11-20
 * Time: 21:15:17
 * 产品库存记录
 */
@Entity
@Table(schema = "mg", name = "product_info")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public class Products {
    private Long id;
    /**
     * 产品流水号
     */
    private String productNo;
    /**
     * 产品类型
     */
    private ProductType productType;
    /**
     * 创建时间
     */
    private Calendar createTime;
    /**
     * 修改时间
     */
    private Calendar modifyTime;
    /**
     * 入库单
     */
    private Stocks outStock;
    /**
     * 出库单
     */
    private Stocks inStock;
    /**
     * 状态(空闲,出借,坏损)
     */
    private String status;
    /**
     * 入价
     */
    private String inPrice;
    /**
     * 出价
     */
    private String outPrice;

    private String serialNo;
    private String remark;
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    @ManyToOne(cascade = {CascadeType.REFRESH},fetch = FetchType.LAZY)
    @JoinColumn(name = "typeId")
    public ProductType getProductType() {
        return productType;
    }

    public void setProductType(ProductType productType) {
        this.productType = productType;
    }

    public String getProductNo() {
        return productNo;
    }

    public void setProductNo(String productNo) {
        this.productNo = productNo;
    }


    public Calendar getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Calendar createTime) {
        this.createTime = createTime;
    }

    public Calendar getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Calendar modifyTime) {
        this.modifyTime = modifyTime;
    }
    @ManyToOne(cascade = {CascadeType.REFRESH},fetch = FetchType.LAZY)
    @JoinColumn(name = "outStock")
    public Stocks getOutStock() {
        return outStock;
    }

    public void setOutStock(Stocks outStock) {
        this.outStock = outStock;
    }
     @ManyToOne(cascade = {CascadeType.REFRESH},fetch = FetchType.LAZY)
    @JoinColumn(name = "inStock")
    public Stocks getInStock() {
        return inStock;
    }

    public void setInStock(Stocks inStock) {
        this.inStock = inStock;
    }




    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getInPrice() {
        return inPrice;
    }

    public void setInPrice(String inPrice) {
        this.inPrice = inPrice;
    }

    public String getOutPrice() {
        return outPrice;
    }

    public void setOutPrice(String outPrice) {
        this.outPrice = outPrice;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }
}
